package org.njyinghuo.sdk.bytedance.client.douyin;

import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpUtil;
import org.njyinghuo.sdk.bytedance.conf.Config;

/**
 * @description:
 * @author: Hupengpeng
 * @time: 2021/7/6 16:27
 */
public class VideoList {
    private String open_id;
    private String access_token;
    private int cursor;
    private int count;
    private String response;
    private VideoList() {
    }

    public static VideoList New() {
        return new VideoList();
    }

    public VideoList execute() {
        String url = StrUtil.format("{}{}?open_id={}&access_token={}&cursor={}&count={}",
                Config.API_HTTP_SCHEME + Config.API_HOST,
                Config.API_VIDEO_LIST,
                getOpen_id(),
                getAccess_token(),
                getCursor(),
                getCount());
        String rs = HttpUtil.get(url);
        response = rs;
        return this;
    }

    public String getOpen_id() {
        return open_id;
    }

    public VideoList setOpen_id(String open_id) {
        this.open_id = open_id;
        return this;
    }

    public String getAccess_token() {
        return access_token;
    }

    public VideoList setAccess_token(String access_token) {
        this.access_token = access_token;
        return this;
    }

    public int getCursor() {
        return cursor;
    }

    public VideoList setCursor(int cursor) {
        this.cursor = cursor;
        return this;
    }

    public int getCount() {
        return count;
    }

    public VideoList setCount(int count) {
        this.count = count;
        return this;
    }

    public String getResponse() {
        return response;
    }

    public VideoList setResponse(String response) {
        this.response = response;
        return this;
    }
}
